<?php
    require("../models/webconfig.php");
    require("../models/class.connection.php");
    require("../models/entities/class.CategoryEntity.php");
    require("../models/repositories/class.CategoryRepository.php");
    
    $categoryRepository = new CategoryRepository();
    $lstCategory = $categoryRepository->GetAll();
    echo "<table>";
    $count = 0;
    while ($count < count($lstCategory))
    {
    	echo "<tr>";
    	for ($i = $count; $i < count($lstCategory); $i++)
    	{
    		echo "<td><div class='item'><input class='cbCategory' type='checkbox' categoryID = '" . $lstCategory[$i]->ID_i . "' value='" . $lstCategory[$i]->Name_s . "' />" . $lstCategory[$i]->Name_s . "</div></td>";
    		if (++$count % 4 == 0)
    		{
    			break;
    		}
    	}
    	echo "</tr>";
    }
    echo "</table>";
?>